<? 
	session_start();
	require("Admin/connect.php");	
	$maltl=$_POST["maltl"];
	$tentl=$_POST["tentl"];			
	$duongdan=$_FILES["file_upload"]["name"];
	$mota=$_POST["mota"];
	$nguoidang=$_SESSION["username"];	
	$ngay=date("Y-m-d");
	move_uploaded_file($_FILES["file_upload"]["tmp_name"],"tainguyen/".$_FILES["file_upload"]["name"]);
	if ($_FILES["pimage"]["error"]==0){		
		$sql="insert into tailieu(maltl,tentl,duongdan,mota,nguoidang,ngay) values('{$maltl}','{$tentl}','{$duongdan}','{$mota}','{$nguoidang}','{$ngay}')";	
		mysql_query("$sql") or die("Error!");
		mysql_close();
		header("Location:index.php");			
	} else
	{
		exit(-1);
	}									
?>